import requests, json, datetime


def get_session():
    login_url = 'https://auth.xincheng.com/LoginService.ashx'
    login_data = {
        'lang': 'en - us',
        'systemCode': 'A07',
        'rememberPassword': 'false',
        'challengeNumber': '',
        'randomDate': str(datetime.datetime.now().strftime("%Y-%m-%d")),
        '15': '34:50',
        'hidetxtPassword': 'lU/Q3OulShPF0iazGNk5O7YGzt9cMlFGiz5l/m73bCJ9WSVGCtqmnHroP6IjSat4m7HTQlMn9VGVbAssdYyR4BOsEdjB3lTY4wmzqd8gfwV5YpbaeoERAzuwpl7QzCyjEnV34Nu7eMlyXZrJLxdGLEdVxdKetMMhJlT2y5sKL1SrpPW4i5sJRC2uH2Jh2qeWkOEW87C8QF9Tyr+Hhyx8ZjH0RbtKW82gLG+edUxls2nXZ6rMkZHmOh9QrPc2/ORlIYAHItYHyd098/6+afAQavKHcmh8kGmmNW0uZYOs57ZJxwLpJ2NoDOX+YWgS57Wh6ceQXqZR3Gt7b+dDN7M1gw==',
        'txtIsTrustAccessor': 'True',
        'txtUserName': 'wangrui20',
    }
    login_header = {
        'Referer': 'https://auth.xincheng.com/?challengeNumber=ZGY5eGpsaGt5NTB0cWRlcHJ0c2h1OXVuMDBlMHFnbXMwN2JmZGEzYmEyNTlsaHFtYXN5MHlheWRjOGNsZmIyZjF4ejJ0b3BvbW1mMHl4ZTR4b2ZlcnlrdGVsemRncG1yY3MybzVicmxyOHlqdDRsbTgzb2I5d2tpOGx3dnlvMW9zOXJ6azh4OWRoYnVkd253b2pubHNpbmN2Y3ZvOWttNjBtcW14MWV2NDFnOHpmc2s4bHN2ZmN3aGk0Y2RhZXR4c2JtbjJmYmZ6cWV1MWlibnE2OGUyOTd4azBpMGd5ODlrMmFqM2w3djMxb2d5c3N1bnFnYWFjNHV6YWluZWY5cA==&flag=3&systemCode=A07&RetutnUrl=http%3A%2F%2Fekp.xincheng.com%2Fsys%2Fportal%2Fpage.jsp',
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',
    }
    session = requests.session()
    session.post(login_url, data=login_data, headers=login_header)
    return session
